Skip to content

Update outbox macro #5970

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 22, 2024
Merged

Conversation

smithellis
Copy link
Contributor

No description provided.

Comment on lines 58 to 62
{% set comma = joiner(', ') %}
{% for user in message.to.all() -%}
{{ comma() }}
{{ name_link(user) }}
{%- endfor %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice change, but now the inner loop should be removed and the set comma ... moved outside the loop.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Thanks. I saw another piece that needed updated as well thanks to this!

@@ -52,27 +52,27 @@

{% macro outbox_message(message) -%}
<span class="to">
{% if message.recipient %}
{% if message.to %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know, but I'm wondering if it would be better to use if message.recipients_count > 0 here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

Comment on lines 58 to 63
{% for user in message.to.all() -%}
{{ comma() }}
{{ name_link(user) }}
{%- endfor %}
{% else %}
{{ name_link(message.recipient) }}
{% endif %}
{% endfor %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outdent all of these lines -- the for...else...endfor to match the line with the {% set comma = joiner(', ') %}.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did as requested - I need to find some rules/a linter for Jinja files.....

@smithellis smithellis merged commit 8204e0c into mozilla:main Apr 22, 2024
2 checks passed
@smithellis smithellis deleted the read-message-regression branch April 22, 2024 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants